import request from "@/utils/request";

export default {
  getGoodsRecordList(searchModel) {
    return request({
      url: "/transferRecord/list",
      method: "get",
      params: {
        transferId: searchModel.transferId,
        outWarehouseId: searchModel.outWarehouseId,
        saveWarehouseId: searchModel.saveWarehouseId,
        pageNo: searchModel.pageNo,
        pageSize: searchModel.pageSize,
      },
    });
  },

  transferGoods(TransferRecordDto) {
    return request({
      url: "/transferRecord",
      method: "post",
      data: TransferRecordDto,
    });
  },

  // 获取调拨商品数量
  getAllTransferGoodsNum(searchModel) {
    return request({
      url: "/transferRecord/getAllTransferGoodsNum",
      method: "get",
      params: {
        transferId: searchModel.transferId,
        outWarehouseId: searchModel.outWarehouseId,
        saveWarehouseId: searchModel.saveWarehouseId,
        pageNo: searchModel.pageNo,
        pageSize: searchModel.pageSize,
      },
    });
  },

  deleteTransferById(id) {
    return request({
      url: `/transferRecord/${id}`,
      method: "delete",
    });
  },

  // 获取调拨详情
  getInfoList(transferId) {
    return request({
      url: `/transferRecord/${transferId}`,
      method: "get",
    });
  },
};
